package com.shrct.businessprocess.customerservice.events;

import com.shrct.businessprocess.customerservice.RCNonProjectService;
import com.shrct.businessprocess.customerservice.events.RCNonProjectServiceEventsListener;
import com.shrct.businessprocess.organization.RCEmployee;
import edu.fudan.mylang.pf.event.EntityEventsManager;
import java.util.Collection;
import java.util.Date;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("com.shrct.businessprocess.customerservice.events.RCNonProjectServiceEventsManager")
public class RCNonProjectServiceEventsManager extends EntityEventsManager<RCNonProjectService> {
  @Autowired(required = false)
  private Collection<RCNonProjectServiceEventsListener> listeners = com.google.common.collect.Lists.newArrayList();;
  
  protected Collection<RCNonProjectServiceEventsListener> getListeners() {
    return listeners;
  }
  
  public void fireFinish(final RCNonProjectService entity, final Date finishDate, final Collection<RCEmployee> workers, final String finishComment) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCNonProjectServiceEventsListener)listener).finish(entity,finishDate,workers,finishComment);
    }
    
  }
  
  public void fireCancel(final RCNonProjectService entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCNonProjectServiceEventsListener)listener).cancel(entity);
    }
    
  }
  
  public void fireNotifyManager(final RCNonProjectService entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCNonProjectServiceEventsListener)listener).notifyManager(entity);
    }
    
  }
  
  public void fireDelete(final RCNonProjectService entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCNonProjectServiceEventsListener)listener).delete(entity);
    }
    
  }
  
  public void fireUpdate(final RCNonProjectService entity, final Procedure1<? super RCNonProjectService> updator) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCNonProjectServiceEventsListener)listener).update(entity,updator);
    }
    
  }
}
